﻿using System.Collections.Generic;
using System.Linq;
using Missbot.Common;

namespace Missbot.MisskeyClient
{
    public class MisskeyClientMgr : ISingleton
    {
        private List<MisskeyClient> AllClients { get; set; }

        public MisskeyClient this[string name] => AllClients.FirstOrDefault(p => p.Meta.Name == name);

        public void Init()
        {
            AllClients = MisskeyClientMetaDA.GetAll().Select(meta => new MisskeyClient(meta)).ToList();
        }
    }
}